#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    cin>>s;
    int n=s.length();
    int n1,n2,n3;
    n1=(n+2)/3;
    n3=n1;
    n2=n-n1-n3+2;
    //cout<<n1<<" "<<n2<<" "<<n3<<" "<<n<<endl;
    for(int i=0;i<n1-1;i++){
        cout<<s[i];
        for(int j=0;j<n2-2;j++)
            cout<<" ";
        cout<<s[n-i-1]<<endl;
    }
    cout<<s.substr(n1-1,n2)<<endl;
    return 0;
}
